-
Notifications
You must be signed in to change notification settings - Fork 561
[Feature] support prompt repetition_penalty #2806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
…into repetition_penalty
…into repetition_penalty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要增加单测
} | ||
} | ||
if (i < prompt_len_now) { | ||
int64_t id = prompt_ids[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是prompt_now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,我修复下
int times = repeat_times_now[i]; | ||
float logit_now = static_cast<float>(logits_now[i]); | ||
if (times != 0) { | ||
if (is_repeated[i] != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用is_repeated判断和之前的区别是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
if (i < prompt_len_now) { | ||
int64_t id = prompt_ids[i]; | ||
if (id >= 0) { | ||
atomicAdd(&is_repeated_now[id], 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
出现在prompt的token不用记入repeat_times吗,这块逻辑是否与模型组确认
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support Prompt Repetition Penalty